import copy
import torch

'''BuildDataloader'''
def BuildDataloader(dataset, dataloader_cfg):
    dataloader_cfg = copy.deepcopy(dataloader_cfg)
    # build dataloader
    shuffle = dataloader_cfg.pop('shuffle')
    dataloader = torch.utils.data.DataLoader(dataset, **dataloader_cfg)
    # return
    return dataloader
